#ifndef BOX_H
#define BOX_H

#include<QMainWindow>
#include<qpainter.h>
#include<qstring.h>
#include<qrect.h>
#include<QKeyEvent>
#include<QFont>
#include<QPixmap>
#include<QPaintEvent>
#include<QLabel>
#include<QWidget>
#include<QTranslator>
#include<QLocale>
#include<QApplication>

QT_BEGIN_NAMESPACE
namespace Ui { class box; }
QT_END_NAMESPACE

class box : public QMainWindow
{
    Q_OBJECT

public:
    box(QWidget *parent = nullptr);
    ~box();
    void paintEvent(QPaintEvent *event);
    void init_1st();
    void init_2nd();
    void ismanhitwall();
    void isboxhitwall();
    void isin();

private slots:
    void da_update();
    void box_update();

private:
    Ui::box *ui;
    QRect manrect;
    QRect boxrect[5];
    QRect holes[5];
    QRect wall[37];
    QString sDisplay;
    void keyPressEvent(QKeyEvent *key);
    int round;
    int nDirection;
    bool inhole[5];
    bool next;
};

#endif // BOX_H
